package ace.module.weixin.core.impl.dao.entity;

import jakarta.annotation.Nullable;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.experimental.SuperBuilder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.annotation.Version;
import org.springframework.data.relational.core.mapping.Table;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotEmpty;
import java.io.Serializable;
import ace.cmp.spring.data.jdbc.querydsl.core.annotations.LogicDelete;
import ace.cmp.spring.graphql.core.model.GenericPageContent;
import ace.module.weixin.api.model.dto.WxsMiniAppConfigDto;

/**
* 微信小程序配置.
*
* @author Caspar
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(title = WxsMiniAppConfigDto.TABLE_DESC)
@Table(WxsMiniAppConfigDto.TABLE_NAME)
public class WxsMiniAppConfig implements Serializable, GenericPageContent<Long> {

  @Id
  @Schema(title = WxsMiniAppConfigDto.ID_TITLE, description = WxsMiniAppConfigDto.ID_DESC)
  private Long id;

  @Size(max = 255)
  @Schema(title = WxsMiniAppConfigDto.APP_ID_TITLE, description = WxsMiniAppConfigDto.APP_ID_DESC)
  private String appId;

  @Size(max = 255)
  @Schema(title = WxsMiniAppConfigDto.APP_SECRET_TITLE, description = WxsMiniAppConfigDto.APP_SECRET_DESC)
  private String appSecret;

  @Size(max = 255)
  @Schema(title = WxsMiniAppConfigDto.TOKEN_TITLE, description = WxsMiniAppConfigDto.TOKEN_DESC)
  private String token;

  @Size(max = 255)
  @Schema(title = WxsMiniAppConfigDto.AES_KEY_TITLE, description = WxsMiniAppConfigDto.AES_KEY_DESC)
  private String aesKey;

  @Size(max = 255)
  @Schema(title = WxsMiniAppConfigDto.MSG_DATA_FORMAT_TITLE, description = WxsMiniAppConfigDto.MSG_DATA_FORMAT_DESC)
  private String msgDataFormat;

  @Size(max = 255)
  @Schema(title = WxsMiniAppConfigDto.ORIGINAL_ID_TITLE, description = WxsMiniAppConfigDto.ORIGINAL_ID_DESC)
  private String originalId;

  @Size(max = 255)
  @Schema(title = WxsMiniAppConfigDto.HTTP_PROXY_HOST_TITLE, description = WxsMiniAppConfigDto.HTTP_PROXY_HOST_DESC)
  private String httpProxyHost;

  @Schema(title = WxsMiniAppConfigDto.HTTP_PROXY_PORT_TITLE, description = WxsMiniAppConfigDto.HTTP_PROXY_PORT_DESC)
  private Integer httpProxyPort;

  @Size(max = 255)
  @Schema(title = WxsMiniAppConfigDto.HTTP_PROXY_USERNAME_TITLE, description = WxsMiniAppConfigDto.HTTP_PROXY_USERNAME_DESC)
  private String httpProxyUsername;

  @Size(max = 255)
  @Schema(title = WxsMiniAppConfigDto.HTTP_PROXY_PASSWORD_TITLE, description = WxsMiniAppConfigDto.HTTP_PROXY_PASSWORD_DESC)
  private String httpProxyPassword;

  @Size(max = 255)
  @Schema(title = WxsMiniAppConfigDto.API_HOST_URL_TITLE, description = WxsMiniAppConfigDto.API_HOST_URL_DESC)
  private String apiHostUrl;

  @Size(max = 255)
  @Schema(title = WxsMiniAppConfigDto.ACCESS_TOKEN_URL_TITLE, description = WxsMiniAppConfigDto.ACCESS_TOKEN_URL_DESC)
  private String accessTokenUrl;

  @Size(max = 255)
  @Schema(title = WxsMiniAppConfigDto.NAME_TITLE, description = WxsMiniAppConfigDto.NAME_DESC)
  private String name;

  @Size(max = 255)
  @Schema(title = WxsMiniAppConfigDto.REMARK_TITLE, description = WxsMiniAppConfigDto.REMARK_DESC)
  private String remark;

  /**
   * {@link ace.module.weixin.api.enums.WxsMiniAppConfigStatusEnum}
   */
  @Schema(title = WxsMiniAppConfigDto.STATUS_TITLE, description = WxsMiniAppConfigDto.STATUS_DESC)
  private Integer status;

  @LogicDelete
  @Schema(title = WxsMiniAppConfigDto.DELETE_FLAG_TITLE, description = WxsMiniAppConfigDto.DELETE_FLAG_DESC)
  private Long deleteFlag;

  @CreatedDate
  @Schema(title = WxsMiniAppConfigDto.CREATE_TIME_TITLE, description = WxsMiniAppConfigDto.CREATE_TIME_DESC)
  private Long createTime;

  @LastModifiedDate
  @Schema(title = WxsMiniAppConfigDto.UPDATE_TIME_TITLE, description = WxsMiniAppConfigDto.UPDATE_TIME_DESC)
  private Long updateTime;

  @Version
  @Schema(title = WxsMiniAppConfigDto.ROW_VERSION_TITLE, description = WxsMiniAppConfigDto.ROW_VERSION_DESC)
  private Long rowVersion;

}
